<template>
    <div>
        <Navbar title="首页" :left="true" @leftEvent="handleLeft"></Navbar>
        <Navbar title="我的" :left="false" ref="mynav"></Navbar>
    </div>
</template>

<script>
import { ref } from 'vue';
import Navbar from './Navbar.vue';

export default {
    components: {
        Navbar
    },
    setup() {

        const mynav = ref(null)

        const handleLeft = (ctx) => {
            console.log("父组件收到子组件通知：", ctx);
            console.log("$refs", mynav.value);
        }
        return {
            mynav,
            handleLeft
        }
    },
}
</script>